//
// Forward declare functions
//

/* Currently no functions to forward declare */

//
// Set constants
//
const CTRLID_LOGON_FORM='logonform';
const CTRLID_USER_ID='usr_name';
const CTRLID_PASSWORD='usr_password';
const CTRLID_REMEMBER_MY_USER_ID='remember';


function handleHomePage(page)
{
    var frmLogon = getElementByIdCompatible(CTRLID_LOGON_FORM);
    
    if (!validateControls(page.moniker, [frmLogon])) return;

    var txtUsername = getElementByIdCompatible(CTRLID_USER_ID);
    var txtPassword = getElementByIdCompatible(CTRLID_PASSWORD);
    var chkRemember = getElementByIdCompatible(CTRLID_REMEMBER_MY_USER_ID);
    var btnSubmit = getElementsByTagNameAndType(frmLogon, 'input', 'image')[0];   
    
    if (!validateControls(page.moniker, [txtUsername, txtPassword, chkRemember, btnSubmit])) return;
    
    // Set the username and submit the form
    txtUsername.value = USERNAME;
    txtPassword.value = PASSWORD;
    chkRemember.checked = false;
    btnSubmit.click();
}
